import { Router, Route, Switch, Redirect } from 'react-router-dom'
import { customHistory } from '@/utils'
import { AuthRoute } from '@/components/AuthRoute'
import Layout from './pages/Layout'
import Login from './pages/Login'
import NotFound from './pages/NotFound'
import './App.scss'

const App = () => {
  return (
    <Router history={customHistory}>
      <Switch>
        <Route exact path="/" render={() => <Redirect to="/home" />}></Route>
        {/* 自己分装路由鉴定组件   */}
        <AuthRoute path="/home" component={Layout}></AuthRoute>
        <Route path="/Login" component={Login}></Route>
        <Route component={NotFound}></Route>
      </Switch>
    </Router>
  )
}

export default App
